<template>
  <div id="user">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>用户中心</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- <input type="text" v-model="username"/> -->
    <h2>用户中心</h2>
    <!-- <button @click="login">登录</button> -->

    <!-- {{$store.state.people}} -->
    <router-view/>
  </div>
</template>
 
<script>

import store from '@/store/index'

import axios from "axios";
export default {
  name: 'User',
  data(){
    return{
        username:""
    }
  },
    methods:{
      login:function(){
        var name = this.username;
        this.$store.commit('LOGIN_IN',"asd123");
      
        axios({
            url: 'http://localhost:3300/login',
            method: 'get',
            params: {
                'user':this.username
            }
        }).then(res => {
            console.log(res)
        }).catch(err => console.error)

      }
    },
  store
}
</script>